package com.gton.router.impl;

import com.gton.io.RPCCommonRequest;
import com.gton.io.Resp;
import com.gton.router.RemoteThirdSysRouterService;
import com.gton.service.GotoThirdSysRouterService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: RPC服务提供接口
 * @author: GuoTong
 * @createTime: 2022-10-22 15:17
 * @since JDK 1.8 OR 11
 **/
@Service
@DubboService
@Slf4j
public class DubboUserManagerService implements RemoteThirdSysRouterService {

    @Autowired
    private GotoThirdSysRouterService gotoThirdSysRouterService;

    /**
     * Description: RPC 远程过程调用提供方|提供Router服务远程过程调用
     *
     * @return
     * @author: GuoTong
     * @date: 2022-10-22 15:18:56
     */
    @Override
    @SuppressWarnings("uncheked")
    public Resp requestInfo(RPCCommonRequest rpcCommonParam) {
        log.info("链路追踪：TraceID = {}  ;请求参数 = {}", rpcCommonParam.getTraceId(), rpcCommonParam.toString());
        return gotoThirdSysRouterService.createMapData(rpcCommonParam);
    }
}
